import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'



Vue.use(Vuex)

// 应用初始状态
const state = {
    count: 10,
    merchantInfo:{},
    tenanceData:null,
    tructionData: null,
    loginName:'',
    LoginStatus:{
        userId:'',
        token:'',
        nickName:'小宝',
        iconUrl:'http://116.62.22.58:8030/bapi/upload/20180126/file5a6a931cdb573c634e310d43.jpg'
    }

}

// 定义所需的 mutations
const mutations = {
 
    SETBALL(state,ball) {
        state.ballOrderList=[]
        state.ballOrderList=ball
    },
    setMerchant(state,opt){
        state.merchantInfo  = opt
    },
    setLoginStatus(state,opt){
        state.LoginStatus  = opt
    },
    setTenanceData(state,opt){
    	state.tenanceData  = opt
    },
    setTructionData(state,opt){
    	state.tructionData  = opt
    },
    setLoginName(state,opt){
    	state.loginName  = opt
    }
    
}

// 创建 store 实例
export default new Vuex.Store({
    actions,
    getters,
    state,
    mutations
})